Skip to content

Conversation

@chrip
Copy link

@chrip chrip commented Oct 29, 2025

Fixes #7009

Ensure leftover Windows installers (.msi) and the msiexec log (msi.log) are removed after updates,
both for internal updater flow and for externally performed (manual) installs.

What I changed

  • NSISUpdater::wipeUpdateData() now removes update file and msi.log and logs failures.
  • handleStartup() will now call wipeUpdateData() if the update was performed externally.

How to test

  1. Case A (internal updater): simulate a download -> run installer via updater -> restart client -> verify .msi and msi.log are removed.
  2. Case B (manual install): download .msi to the config path, run it manually to update, start client -> confirm leftover files are removed.
  3. Check logs for messages like "Removed updater file" / "Removed msi log file" or warning messages if removal failed.

Notes

Fixes #7009

Ensure leftover installer and msi.log are removed after external manual or internal updates. Improve logging on delete/copy failures. Fixes nextcloud#7009.

Signed-off-by: chrip <[email protected]>
@chrip chrip marked this pull request as draft October 29, 2025 13:34
@github-actions
Copy link

Artifact containing the AppImage: nextcloud-appimage-pr-8980.zip

Digest: sha256:a34a2b52199b8ee8e90f5b6cc6f5c7492a5b73c7a0f174506e3410b5fd03cff7

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

Copy link
Collaborator

@Aiiaiiio Aiiaiiio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Please see my comments as suggestions.

}
}
// Also try to remove the msi log file (created when running msiexec)
QString msiLogFileName = cfg.configPath() + "msi.log";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider using a constant for msi.log.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I’ve added a separate commit introducing a constant msiLogFileNameC as suggested.

if (QFile::remove(msiLogFileName)) {
qCInfo(lcUpdater) << "Removed msi log file:" << msiLogFileName;
} else {
qCWarning(lcUpdater) << "Failed to remove msi log file:" << msiLogFileName;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be good to check whether the current platform is Windows? I wouldn't expect an msi log on any other system.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Aiiaiiio, thanks for the suggestion! From what I see, the changes are in NSISUpdater::wipeUpdateData() which is a Windows-specific subclass of OCUpdater. So this code isn’t compiled on other platforms than Windows and no additional platform check should be needed.

@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Updater doesn't clean up installer (.msi)

3 participants